#include <common.h>
#include <sys/time.h>

int my_gettimeofday(struct timeval * tv, struct timezone * tz){
  assert(tv);
  tv->tv_sec = io_read(AM_TIMER_UPTIME).us / 1000000;
  tv->tv_usec = io_read(AM_TIMER_UPTIME).us % 1000;
  if(tz){
    tz->tz_minuteswest = 0;
    tz->tz_dsttime = 0;
  }
  return 0;
}
